var t = require;
var e = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var a = (function () {
    function t() {
        this.saveData = [];
        this.randItem = [];
    }
    t.prototype.reset = function () {
        for (var t = 0; t < this.saveData.length; t++)
            for (var e = this.saveData[t], o = 3 * t, a = 0; a < 3; a++)
                null != this.randItem[o + a] ? (this.randItem[o + a] = e) : this.randItem.push(e);
    };
    t.prototype.addVal = function (t) {
        this.saveData.push(t);
    };
    t.prototype.addOceVal = function (t) {
        this.saveData.indexOf(t) < 0 && this.saveData.push(t);
    };
    t.prototype.getRandVal = function () {
        if (this.randItem.length > 0) {
            var t = Math.floor(Math.random() * this.randItem.length);
            return this.randItem.splice(t, 1)[0];
        }
        this.reset();
        if (this.randItem.length > 0) {
            t = Math.floor(Math.random() * this.randItem.length);
            return this.randItem.splice(t, 1)[0];
        }
        return null;
    };
    t.prototype.removeVal = function (t) {
        for (var e = 0; e < this.randItem.length; e++)
            if (this.randItem[e] == t) {
                this.randItem.splice(e, 1);
                break;
            }
    };
    return t;
})();
o.default = a;
